//
//  SVProgressViewHUDExtension.swift
//  HuaDaoPeifu
//
//  Created by Erickson on 16/4/7.
//  Copyright © 2016年 paiyipai. All rights reserved.
//

import UIKit
import SVProgressHUD


extension SVProgressHUD {
    class func showError(_ errorString:String!) {
        SVProgressHUD.setMinimumDismissTimeInterval(1.5)
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.showError(withStatus: errorString)
        
    }
    class func showSuccess(_ successString:String!) {
        SVProgressHUD.setMinimumDismissTimeInterval(1.5)
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.showSuccess(withStatus: successString)

        
    }
    class func showStatus(_ statusString:String!) {
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.showInfo(withStatus: statusString)
        
    }
    
    class func showStatusWithLoading(_ status:String!) {
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.setDefaultMaskType(.none)

        SVProgressHUD.show(withStatus: status)
    }
    
    class func showDisableLoading(_ loadingMsg:String?) {
        
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.setDefaultMaskType(.custom)
        SVProgressHUD.show(withStatus: loadingMsg)
    }
    
    class func showDisableProgress(_ progress:Float) {
        SVProgressHUD.showProgress(progress)
        SVProgressHUD.setDefaultStyle(.dark)
        SVProgressHUD.setDefaultMaskType(.gradient)

    }
    
}
